package com.example.asynchttpdemo;

import com.loopj.android.http.AsyncHttpClient;
import com.loopj.android.http.AsyncHttpResponseHandler;
import com.loopj.android.http.RequestParams;

public class TwitterRestClient {
	private static final String	   BASE_URL	 = "http://56cyt.com";

	private static final String	   login_url	= "";

	private static AsyncHttpClient	client	 = new AsyncHttpClient();

	private static void get(String url,RequestParams params,AsyncHttpResponseHandler responseHandler) {
		client.get(getAbsoluteUrl(url), params, responseHandler);
	}

	private static void post(String url,RequestParams params,
	        AsyncHttpResponseHandler responseHandler) {
		client.post(getAbsoluteUrl(url), params, responseHandler);
	}

	private static String getAbsoluteUrl(String relativeUrl) {
		return BASE_URL + relativeUrl;
	}

	public static void login(RequestParams params,AsyncHttpResponseHandler responseHandler) {
		client.post(getAbsoluteUrl(login_url), params, responseHandler);
	}
}
